package com.base.exe1;

import java.util.Scanner;
import java.util.UUID;

public class Exe1 {
    public static void main(String[] args) {
//        num_4();
//        num_7();
//        num_8();
//        num_9();
//        num_10();
//        num_11();
//        num_12();
          num_13();
    }
    static void num_4(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入阶乘数(2/4/6/8/10):");
        int i = scanner.nextInt();
        int num = 1;
        for (int j = 1; j <=i ; j++) {
            num*=j;
        }
        System.out.println(i+"的阶乘为:"+num);
    }
    static void num_7(){
        for (int i = 4; i > 0 ; i--) {
            for (int k = 0;k<7-(2*i-1);k++) {
                System.out.print(" ");
            }
            for (int j = 0;j<2*i-1;j++) {
                System.out.print("* ");
            }
            for (int k = 0;k<7-(2*i-1);k++) {
                System.out.print(" ");
            }
            System.out.println();
        }
        for (int i = 2; i <=4 ; i++) {
            for (int k = 0;k<7-(2*i-1);k++) {
                System.out.print(" ");
            }
            for (int j = 0;j<2*i-1;j++) {
                System.out.print("* ");
            }
            for (int k = 0;k<7-(2*i-1);k++) {
                System.out.print(" ");
            }
            System.out.println();

        }
    }
    static void num_8(){
        for (int i = 10; i >= 1 ; i--) {
            for (int j = 1; j <= i ; j++) {
                System.out.print("* ");
            }
            System.out.println();
        }
    }
    static void num_9(){
        for (int i = 1; i <= 9 ; i++) {
            for (int j = 1; j <= i ; j++) {
                System.out.print(j+" * "+i+" = "+i*j+"  ");
            }
            System.out.println();
        }
    }
    static void num_10(){
        System.out.println("输入一个字符串");
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        StringBuilder stringBuilder = new StringBuilder(s);
        if(stringBuilder.reverse().toString().equals(s)){
            System.out.println(s+" 是一个回文串");
        }else {
            System.out.println(s+" 不是一个回文串");
        }

    }
    static void num_11(){
        System.out.println("输入一个数:");
        Scanner sc = new Scanner(System.in);
        int i = sc.nextInt();
        if (i <= 3){
            System.out.println(i+"是一个素数");
        }else{
            boolean istrue = true;
            for (int j = 2; j < i ; j++) {
                if (i % j == 0){
                    istrue = false;
                    break;
                }
            }
            if (istrue){
                System.out.println(i+"是一个素数");
            }else {
                System.out.println(i+"不是一个素数");
            }

        }
    }
    static void num_12(){
        System.out.println("输入一个华氏温度:");
        Scanner scanner = new Scanner(System.in);
        float v = scanner.nextFloat();
        float w = (float) ((v-32)/1.8);
        System.out.printf("摄氏温度为: %.2f",w);
    }
    static void num_13(){
        System.out.println("输入三角形的三条边:");
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        float s = (a+b+c)/2;
        float m = s*(s-a)*(s-b)*(s-c);
        double sqrt = Math.sqrt(m);
        System.out.printf("三角形的面积为:%.2f",sqrt);

    }

}
